<?php
/**
 * Created by PhpStorm.
 * User: Tsang
 * Date: 2017/12/15 11:08
 *
 */

namespace app\api\controller;


class KnowFoods extends Base
{

    //检查权限作用域
    protected $beforeActionList  = [
        'checkPrimaryScope' => [
            'only' => 'comment,collect,thumb,commentThumb,myCollect,detail,commentList,commentDetail'
        ],
    ];


    /**
     * 知食列表
     */
    public function index(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->index()
        );
    }

    /**
     * 知食详情
     */
    public function detail(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->detail()
        );
    }

    /**
     * 评论
     */
    public function comment(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->comment()
        );
    }


    /**
     * 评论
     */
    public function commentList(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->commentList()
        );
    }


    /**
     * 评论详情
     */
    public function commentDetail(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->commentDetail()
        );
    }

    /**
     * 收藏
     */
    public function collect()
    {
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->collection()
        );
    }

    /**
     * 收藏列表
     */
    public function myCollect(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->myCollect()
        );
    }


    /**
     * 点赞
     */
    public function thumb()
    {
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->thumb()
        );
    }


    /**
     * 评论点赞
     */
    public function commentThumb(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->commentThumb()
        );
    }

    /**
     * 轮播图
     */
    public function banner(){
        return $this->ajaxReturn(
            (new \app\api\logic\KnowFoods())->banner()
        );
    }


}